package com.amigo.online.consumer.user.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.amigo.online.common.base.controller.BaseConsumerController;
import com.amigo.online.common.core.response.Response;
import com.amigo.online.consumer.user.service.LikeService;
import com.amigo.online.consumer.user.service.UserService;

/**
 * 用户相关
 * @author amigo
 *
 */
@RestController
@RequestMapping(value = "/tan", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class TanController extends BaseConsumerController {
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private LikeService likeService;
	
	
	@GetMapping(value = "/openT")
	public ResponseEntity<Response> openTanTan(){
		return userService.openT();
	}
	
	@GetMapping(value = "/closeT")
	public ResponseEntity<Response> closeTanTan(){
		return userService.closeT();
	}
	
	
	@GetMapping(value = "/like/{userId}")
	public ResponseEntity<Response> likeOne(@PathVariable(value = "userId") Long userId) {
        return likeService.likeOne(userId);
	}
	
	
	@GetMapping(value = "/dislike/{userId}")
	public ResponseEntity<Response> dislikeOne(@PathVariable(value = "userId") Long userId) {
        return likeService.dislikeOne(userId);
	}
	
}
